#include "cylinderReceiverIntersection.cuh"
#include <algorithm/rayTracing/rayTracingPipeline/quasiMonteCarloRayTracing/Receiver/receiverIntersectionUtil.cuh>

using namespace solar::cuda;

__device__ __host__ void cylinderReceiverIntersect::receiver_drawing(
    CudaCylinderReceiver* cylinderReceiver, const float3& orig, const float3& dir,
    const float3& normal, float factor, int is_total_reflect, int myId)
{
    // Step1: Intersect with cylinder receiver
    float t;
    float u;
    float v;

    // float *total_reflect=cylinderReceiver.getDeviceTotal();
    //    int num=0;
    // if (is_total_reflect){
    //    num=1;
    // printf("    quan =%d\n",num);
    //}
    // float3 he_re= rectangleReceiver.focus_center_;
    // printf("%f %f %f\n",he_re.x,he_re.y,he_re.z);
    // atomicAdd(&(total_reflect[myId]),num);

    /*    if(!cylinderReceiver.GIntersect(orig, dir, t, u, v)){
            return;
        }

        // Step 2: Calculate the energy of the light
        float energy = calEnergy(t, dir, normal, factor);
         v=1-v;
        // Step 3: Add the energy to the intersect position
        // Intersect position
        if(v<0.5){
            v+=0.5;
        }else{
            v-=0.5;
        }
        int2 row_col = make_int2(u * cylinderReceiver.getResolution().y, v *
       cylinderReceiver.getResolution().x); int address = row_col.x *
       cylinderReceiver.getResolution().x + row_col.y; // col_row.y + col_row.x * resolution.y float
       *image = cylinderReceiver.getDeviceImage(); atomicAdd(&(image[address]), energy);   //CUDA
       atomic*/
}
